/*
 *  ProtoBufTest.h
 *  PhysicsTest
 *
 *  Created by Micah Pearlman on 12/16/08.
 *  Copyright 2008 Monk Games. All rights reserved.
 *
 */

#ifndef __ProtoBufTest_h__
#define  __ProtoBufTest_h__
#include "DemoApplication.h"
#include "LinearMath/btAlignedObjectArray.h"

// protocol buffer message definitions...
#include "physics.pb.h"
#include "math_types.pb.h"

class btBroadphaseInterface;
class btCollisionShape;
class btOverlappingPairCache;
class btCollisionDispatcher;
class btConstraintSolver;
struct btCollisionAlgorithmCreateFunc;
class btDefaultCollisionConfiguration;

///BasicDemo is good starting point for learning the code base and porting.
class ProtoBufTest : public DemoApplication
	{
		
		//keep the collision shapes, for deletion/cleanup
		btAlignedObjectArray<btCollisionShape*>	m_collisionShapes;
		
		btBroadphaseInterface*	m_broadphase;
		
		btCollisionDispatcher*	m_dispatcher;
		
		btConstraintSolver*	m_solver;
		
		btDefaultCollisionConfiguration* m_collisionConfiguration;
		
		// protocol buffers
		::collada_to_protobuf::library_physics_materials	physics_material_library_;
		::collada_to_protobuf::library_physics_models		physics_model_library_;
		::collada_to_protobuf::library_physics_scenes		physics_scene_library_;
		
		
	public:
		
		ProtoBufTest()
		{
		}
		virtual ~ProtoBufTest()
		{
			exitPhysics();
		}
		void	initPhysics();
		
		void	exitPhysics();
		
		virtual void clientMoveAndDisplay();
		
		virtual void displayCallback();
		
		static DemoApplication* Create()
		{
			ProtoBufTest* demo = new ProtoBufTest;
			demo->myinit();
			demo->initPhysics();
			return demo;
		}
		
		
	};


#endif //  __ProtoBufTest_h__

